package com.mh.study.springcloud.service;

import com.mh.study.springcloud.dao.ResumeDao;
import com.mh.study.springcloud.pojo.Resume;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

/**
 * @author MH
 * @since 2022-02-20
 */
@Service
public class ResumeService {

    @Autowired
    private ResumeDao resumeDao;

    public Resume findDefaultResumeByUserId(Long userId) {
        Resume resume = new Resume();
        resume.setUserId(userId);
        // 查询默认简历
        resume.setIsDefault(1);
        Example<Resume> example = Example.of(resume);
        return resumeDao.findOne(example).orElse(null);
    }

}
